#include "cell.hpp"
#include "cells.hpp"

namespace hms {

Cell::Cell(
	const Cells& cells,
	Index index
) :
	m_cells {cells},
	m_index {index}
{}
	
auto Cell::cells     () const -> const Cells& {
	return m_cells;
}


auto Cell::meshImp() const -> const Mesh& {
	return m_cells.mesh();
}
auto Cell::indexImp() const -> Index {
	return m_index;
}

auto Cell::areaImp() const -> scalar {
	return m_cells.area(m_index);
}
auto Cell::centroidImp() const -> CentroidType {
	return m_cells.centroid(m_index);
}
auto Cell::circumfImp() const -> scalar {
	return m_cells.circumf(m_index);
}

auto Cell::edgeImp() const -> Index {
	return m_cells.edge(m_index);
}
auto Cell::edgesImp() const -> EdgeIndices {
	return m_cells.edges(m_index);
}
auto Cell::nEdgesImp() const -> char {
	return m_cells.nEdges(m_index);
}
auto Cell::isGhostImp() const -> bool {
	return m_cells.isGhost(m_index);
}
auto Cell::domainCellImp() const -> Cell {
	return m_cells.domainCell(m_index);
}

/* medium cost member functions */
auto Cell::isBoundaryImp() const -> bool {
	return m_cells.isBoundary(m_index);
}

/* high cost member functions */
auto Cell::neighboursImp() const -> ArrayXi {
	return m_cells.neighbours(m_index);
}
auto Cell::verticesImp  (bool ordered) const -> ArrayXi {
	return m_cells.vertices(m_index, ordered);
}

} // end namespace hms